<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>H+ 后台主题UI框架 - 空白页</title>
    <meta name="keywords" content="">
    <meta name="description" content="">

    <link rel="shortcut icon" href="favicon.ico"> <link href="__STATIC__/layout/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="__STATIC__/layout/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="__STATIC__/layout/css/font-awesome.css?v=4.4.0" rel="stylesheet">
     <link href="__STATIC__/layout/css/plugins/summernote/summernote.css" rel="stylesheet">
    <link href="__STATIC__/layout/css/plugins/summernote/summernote-bs3.css" rel="stylesheet">
     <link rel="stylesheet" type="text/css" href="__STATIC__/layout/css/plugins/webuploader/webuploader.css">
    <link rel="stylesheet" type="text/css" href="__STATIC__/layout/css/demo/webuploader-demo.css">
    <!-- jqgrid-->
    <link href="__STATIC__/layout/css/animate.css" rel="stylesheet">
    <link href="__STATIC__/layout/css/style.css?v=4.1.0" rel="stylesheet">
    <link href="__STATIC__/layout/css/plugins/sweetalert/sweetalert.css" rel="stylesheet">
    <link href="__STATIC__/layout/css/gyq.css" rel="stylesheet">
    <link rel="stylesheet" href="__STATIC__/layout/css/demo.css" type="text/css">
       <link rel="stylesheet" href="__STATIC__/layout/css/channel.css" type="text/css">

    
    <style>
        .checkbox-inline input[type=checkbox],.radio-inline input[type=radio] {
    margin-top: 4px;
}
        .note-editable{height: 150px}
    </style>
</head>

<body style="color:#333;padding:3px;">
    <!-- 标题 -->
    <div class="page-heade">
      <h1 class="title_color padding-10">新增经销商评估及资料表</h1>
    </div>
    <!-- 标题 -->
    <div class="row-margin-top">
     <form id="f1"  method="post"  class="form-inline">
      <input type="hidden" name="kid" value='{$kid}'/>
      <input type="hidden" name="state" id="state" value=""/>
       <table class="table-bordered table t_table text-center">
           <tr>
            <td style="min-width: 180px;width: 180px"><label for="" class="form-label" >编号</label></td>
            <td>{$no}</td>
             <td style="min-width: 180px;width: 180px"><label for="" class="form-label" >状态</label></td>
            <td class="text-left">草稿</td>
             <td style="min-width: 180px;width: 180px"><label for="" class="form-label" >申请时间</label></td>
            <td class="text-left">{$cday}</td>
           </tr>
            <tr>
            <td style="min-width: 180px;width: 180px"><label for="" >申请人</label></td>
            <td class="text-left">{$user.em_name}</td>
             <td style="min-width: 180px;width: 180px"><label for="" >联系电话<span class="colorRed">*</span></label></td>
            <td class="text-left" colspan="3"><input type="text" name="lianxiphone" value="1334928927" class="form-control"></td>
           
           </tr>
          </table>
           <table class="table-bordered table t_table text-left">
            <tr>
            <th class="font-bold info" colspan="3">一、调整区域情况</th>
            </tr>
            <tr>
              <td style="min-width: 180px;width: 180px" colspan="2">
              <label for="" >计划经销区域<span class="colorRed">*</span></label>
              <div class="form-group">
                分区 <select name="fenqu" id="zon" class="form-control">
                    <option value="0" selected>请选择</option> 
                    {volist name="zon" id="z"}
                    <option value="{$z.id}">{$z.title}</option>
                    {/volist}
            </select>
              </div>
              <div class="form-group">
                省份 <select name="sheng" id="provices" class="form-control">
                    <option value="0">请选择</option>
                  
            </select>
              </div>
              <div class="form-group">
                城市 <select name="shi" id="citys" class="form-control">
                    <option value="0">请选择</option>
                  
            </select>
              </div>
               <div class="form-group">
                县/区 <input type="text" name="qu" class="form-control">
              </div>
              </td>
            </tr>
            <tr>
             <td>
               <label for="" class="form-label">计划签约时间<span class="colorRed">*</span>：</label>
             <div class="form-group">
            <input type="text" id="start" name="start" class="form-control layer-date" style="min-width:120px;width:120px;height: 26px;display: inline-block;">
           </div>
            <div class="form-group">
                至
            </div>
           <div class="form-group">
            <input type="text" class="form-control layer-date" style="min-width:120px;width:120px;height: 26px;display: inline-block;" name="end" id="end">
           </div>
            </td>
            <td>
               <label for="" class="form-label">计划月均销售目标<span class="colorRed">*</span>：</label>
               <input type="text" class="form-control num2" name="target_sale">万元
            </td>
            </tr>
            <tr>
                <td>
                  <div class="col-xs-4">
                   <label for="" class="form-label">计划经销产品系列<span class="colorRed">*</span>：</label>
                  </div>
                     <div class="col-xs-4">
                        <div class="input-group" id="" >
                            <input type="text"   placeholder="请输入关键字或空格查询" class="form-control inputremindPeple" id="product"  value="{:isset($supply)?$supply.jxs:''}">
                            <input type="hidden" name="pros" id="pros"/>
                            <div class="input-group-btn">
                                <ul class="dropdown-menu dropdown-menu-right" role="menu">
                                </ul>
                            </div>
                        </div>
                    </div>
                    <div class="col-xs-2">
                        <button class="btn btn-primary btn-sm" id="select_product">选择</button>
                    </div>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                   <div class="duoxuan" id="selected_product"></div>
                </td>
            </tr>
           </table>
           <table class="table-bordered table t_table text-left">
           <tr>
               <th class="font-bold info" colspan="6">二、新增经销商基本资料</th>
           </tr>
           <tr>
              <td colspan="6">
                <div class="form-group">
                  <label for="" class="form-label">经销商编号<span class="colorRed">*</span>：</label>
                  <input type="text" name="jxs_no" class="form-control" >
                </div>
              </td>
           </tr>
           <tr>
              <td colspan="3">
                 <div class="form-group" style="min-width: 500px;width: 500px">
                  <label for="" class="form-label">经销商全称<span class="colorRed">*</span>：</label>
                  <input type="text" name="jxs_name" class="form-control" >
                </div>
              </td>
              <td colspan="3">
                 <div class="form-group">
                  <label for="" class="form-label">开户时间：</label>
                 <span>{$cday}</span>
                </div>
              </td>
           </tr>
           <tr>
              <td style="min-width: 160px;width: 160px">经销商类型</td>
              <td colspan="5">
                 <div class="form-group">
                 <label class="radio-inline">
                      <input type="radio" name="jxs_type" checked id="inlineRadio1" value="1">A.根据地客户
                </label>
                 <label class="radio-inline">
                      <input type="radio" name="jxs_type" id="inlineRadio2" value="2">B.待恢复客户
                </label>
                   <label class="radio-inline">
                      <input type="radio" name="jxs_type" id="inlineRadio3" value="3">C.微型客户
                </label>
                 <label class="radio-inline">
                      <input type="radio" name="jxs_type" id="inlineRadio4" value="4">D.包销客户
                </label>
                <label class="radio-inline">
                      <input type="radio" name="jxs_type" id="inlineRadio5" value="5">E.长期团购客户
                </label>
                <label class="radio-inline">
                      <input type="radio" name="jxs_type" id="inlineRadio6" value="6">F.一次性团购客户
                </label>
                <label class="radio-inline">
                      <input type="radio" name="jxs_type" id="inlineRadio7" value="7">G.特殊通路客户
                </label>
                  <label class="radio-inline">
                      <input type="radio" name="jxs_type" id="inlineRadio8" value="8">H.其他类别客户
                </label>
                   </div>
              </td>
           </tr>
           <tr>
              <td style="min-width: 160px;width: 160px"><label for="" class="form-label">销售占渠道比例<span class="colorRed">*</span>：</label></td>
              <td colspan="5">
                <div class="form-group">
                  <label for="" class="form-label">1、流通网点占</label>
                  <input type="text" class="form-control num2" name="qudao1" style="min-width: 60px;width: 60px; padding:0">%
                </div>
                <div class="form-group">
                  <label for="" class="form-label">2、批发占</label>
                  <input type="text" class="form-control num2" name="qudao2" style="min-width: 60px;width: 60px; padding:0">%
                </div>
                <div class="form-group">
                  <label for="" class="form-label">3、终端网点占</label>
                  <input type="text" class="form-control num2" name="qudao3" style="min-width: 60px;width: 60px; padding:0">%
                </div>
                <div class="form-group">
                  <label for="" class="form-label">4、特殊渠道占</label>
                  <input type="text" class="form-control num2" name="qudao4" style="min-width: 60px;width: 60px; padding:0">%
                </div><br>
                (销售占渠道比例的四项加起来必须为100%！)
              </td>
           </tr>
           <tr>
               <td style="min-width: 160px;width: 160px"><label for="" class="form-label">渠道类别<span class="colorRed">*</span>：</label></td>
               <td colspan="5">
                  <select name="channeltype" id="" class="form-control">
                      <option value="0">请选择</option>
                      {volist name="ct" id="c"}
                      <option value="{$c.id}">{$c.title}</option>
                      {/volist}
                  </select>
               </td>
           </tr>
           <tr>
                <td style="min-width: 160px;width: 160px"><label for="" class="form-label">经营(邮寄)地址<span class="colorRed">*</span></label></td>
               <td colspan="5">
                   <input type="text" name="dizhi" class="form-control" style="min-width: 300px;width: 300px">
               </td>
           </tr>
           <tr>
               <td style="min-width: 160px;width: 160px"><label for="" class="form-label">邮编<span class="colorRed">*</span></label></td>
               <td >
                  <input type="text" name="code" style="min-width: 80px" class="form-control">
               </td>
               <td colspan="2">
                  <span>纳税资格</span>
                   <label class="radio-inline">
                      <input type="radio" name="nashui" checked value="1">A.一般纳税人
                </label>
                 <label class="radio-inline">
                      <input type="radio" name="nashui"  value="2">B.小规模纳税人
                </label>
               </td>
               <td colspan="2">
                  <label for="" class="form-label">纳税人登记号<span class="colorRed">*</span></label>
                  <input type="text" name="nashui_no" class="form-control">
               </td>
           </tr>
           <tr>
              <td style="min-width: 160px;width: 160px"><label for="" class="form-label">企业法人<span class="colorRed">*</span></label></td>
              <td colspan="2"><input type="text" class="form-control" name="faren"></td>
              <td  style="min-width: 160px;width: 160px"><label for="" class="form-label">固定电话<span class="colorRed">*</span></label></td>
              <td colspan="2">
                <input type="text" name="faren_phone_qu" class="form-control" style="min-width: 60px;width: 60px">-
                <input type="text" name="faren_phone" class="form-control" style="min-width: 80px;min-width:80px ">
              </td>
           </tr>
           <tr>
             <td style="min-width: 160px;width: 160px"><label for="" class="form-label">传真<span class="colorRed">*</span></label></td>
             <td colspan="2">
                 <input type="text" name="fax_qu" class="form-control" style="min-width: 60px;width: 60px">-
                <input type="text" name="fax" class="form-control" style="min-width: 80px;min-width:80px ">
             </td>
              <td style="min-width: 160px;width: 160px"><label for="" class="form-label">手机<span class="colorRed">*</span></label></td>
              <td colspan="2">
                <input type="text" class="form-control" name="faren_mobile">
              </td>
           </tr>
           <tr>
              <td style="min-width: 160px;width: 160px"><label for="" class="form-label">法人身份证号<span class="colorRed">*</span></label></td>
              <td><input type="text" name="faren_idcard" class="form-control">(15位/18位)</td>
              <td colspan="4">
                   <div class="form-group">
                   身份
                 <label class="radio-inline">
                      <input type="radio" name="faren_type" checked value="1">A.老板
                </label>
                 <label class="radio-inline">
                      <input type="radio" name="faren_type"  value="2">B.老板配偶
                </label>
                   <label class="radio-inline">
                      <input type="radio" name="faren_type"  value="3">C.老板亲属
                </label>
                 <label class="radio-inline">
                      <input type="radio" name="faren_type"  value="4">D.老板雇员
                </label>
                <label class="radio-inline">
                      <input type="radio" name="faren_type"  value="5">E.其他
                </label>
                   </div>
              </td>
           </tr>
           <tr>
              <td style="min-width: 160px;width: 160px"><label for="" class="form-label">总经理<span class="colorRed">*</span></label></td>
              <td colspan="5">
               <div class="form-group">
                  <label for="" class="form-label">姓名</label>
                  <input type="text" name="manager_name" class="form-control" style="min-width: 80px;width: 80px">
               </div>
                <div class="form-group">
                  <label for="" class="form-label">手机</label>
                  <input type="text" name="manager_mobile" class="form-control" style="min-width: 140px;width: 140px">
               </div>
               <div class="form-group">
                  <label for="" class="form-label">电子邮件</label>
                  <input type="text" name="manager_email" class="form-control" style="min-width: 180px;width: 180px">
               </div>
               <div class="form-group">
                  <label for="" class="form-label">总经理身份证号</label>
                  <input type="text" name="manager_idcard" class="form-control" style="min-width: 180px;width: 180px">
               </div>
              </td>
           </tr>
           <tr>
             <td style="min-width: 160px;width: 160px">身份</td>
             <td colspan="5">
                  <div class="form-group">
                 <label class="radio-inline">
                      <input type="radio" name="manager_type" checked value="1">A.老板
                </label>
                 <label class="radio-inline">
                      <input type="radio" name="manager_type"  value="2">B.老板配偶
                </label>
                   <label class="radio-inline">
                      <input type="radio" name="manager_type"  value="3">C.老板亲属
                </label>
                 <label class="radio-inline">
                      <input type="radio" name="manager_type" value="4">D.老板雇员
                </label>
                <label class="radio-inline">
                      <input type="radio" name="manager_type"  value="5">E.其他
                </label>
                   </div>
             </td>
           </tr>
           <tr>
             <td style="min-width: 160px;width: 160px"><label for="" class="form-label">主要业务负责人<span class="colorRed">*</span></label>
             </td>
             <td><input type="text" name="main_sales" class="form-control" style="min-width: 100px;width: 100px"></td>
              <td>
                <label for="" class="form-label">固定电话<span class="colorRed">*</span></label>
               
              </td>
               <td  style="min-width: 180px;width: 200px">
                  <input type="text" name="main_sales_phone_qu" class="form-control" style="min-width: 60px;width: 60px">-
                <input type="text" name="main_sales_phone" class="form-control" style="min-width: 100px;width:100px ">
                </td>
              <td>
                <label for="" class="form-label">传真<span class="colorRed">*</span></label>
                  <input type="text" name="main_sales_fax_qu" class="form-control" style="min-width: 60px;width: 60px">-
                <input type="text" name="main_sales_fax" class="form-control" style="min-width: 100px;width:100px ">
              </td>
              <td>
                 <label for="" class="form-label">手机</label>
                  <input type="text" name="main_sales_mobile" class="form-control" style="min-width: 120px;min-width:120px ">
              </td>
           </tr>
              <tr>
             <td style="min-width: 160px;width: 160px"><label for="" class="form-label">财务负责人<span class="colorRed">*</span></label>
             </td>
             <td><input type="text" name="caiwu" class="form-control" style="min-width: 100px;width: 100px"></td>
              <td>
                <label for=""  class="form-label">固定电话<span class="colorRed">*</span></label>
              
              </td>
                <td style="min-width: 200px;width: 200px">
                    <input type="text" name="caiwu_phone_qu" class="form-control" style="min-width: 60px;width: 60px">-
                <input type="text" name="caiwu_phone" class="form-control" style="min-width:100px;width:100px ">
                </td>
              <td>
                <label for="" class="form-label">传真<span class="colorRed">*</span></label>
                <input type="text" name="caiwu_fax_qu" class="form-control" style="min-width: 60px;width: 60px">-
                <input type="text" name="caiwu_fax" class="form-control" style="min-width: 100px;width:100px ">
              </td>
              <td>
                 <label for="" class="form-label">手机</label>
                  <input type="text" name="caiwu_mobile" class="form-control" style="min-width: 120px;min-width:120px ">
              </td>
           </tr>
        </table>
          <table class="table-bordered table t_table text-left">
          <tr>
            <th class="info font-bold" colspan="4">三、新增经销商目前经营状况</th>
          </tr>
          <tr>
            <td colspan="2">
               <label for="" class="form-label">经销商所在地</label>
                 <label class="radio-inline">
                      <input type="radio" name="jxs_location" checked value="1">A.市区
                </label>
                 <label class="radio-inline">
                      <input type="radio" name="jxs_location"  value="2">B.郊区
                </label>
                <label class="radio-inline">
                      <input type="radio" name="jxs_location"  value="3">C.乡/镇
                </label>
            </td>
            <td colspan="2">
               <label for="" class="form-label">是否在批发市场</label>
                 <label class="radio-inline">
                      <input type="radio" name="is_pifa" checked value="1">是
                </label>
                 <label class="radio-inline">
                      <input type="radio" name="is_pifa"  value="2">否
                </label>
            </td>
          </tr>
          <tr>
            <td colspan="2">
                <label for="" class="form-label">经销商<span class="colorRed">*</span></label>
              <div class="form-group">
                 <label for="" class="form-label">业务经理</label>
                 <input type="text" name="jxs_manager_num" style="min-width: 60px;width: 60px" class="form-control num">人;
              </div>
              <div class="form-group">
                 <label for="" class="form-label">业务代表</label>
                 <input type="text" name="jxs_sales_num" style="min-width: 60px;width: 60px" class="form-control num">人;
              </div>
               <div class="form-group">
                 <label for="" class="form-label">会计</label>
                 <input type="text" name="jxs_caiwu_num" style="min-width: 60px;width: 60px" class="form-control num">人;
              </div>
            </td>
             <td colspan="2">
                <label for="" class="form-label">业务负责人<span class="colorRed">*</span></label>
              <label class="radio-inline">
                      <input type="radio" name="fuzeren_type" checked  value="1">A.老板
                </label>
                 <label class="radio-inline">
                      <input type="radio" name="fuzeren_type"  value="2">B.老板配偶
                </label>
                <label class="radio-inline">
                      <input type="radio" name="fuzeren_type"  value="3">C.业务经理
                </label>
                 <label class="radio-inline">
                      <input type="radio" name="fuzeren_type"  value="4">D.其他
                </label>
            </td>
          </tr>
          <tr>
              <td style="min-width: 160px;width: 160px"><label for="" class="form-label">配送能力<span class="colorRed">*</span></label>
             </td>
             <td>
                <div class="form-group">
                  有<input type="text" class="form-control num" name="car_num" style="min-width: 60px;width: 60px">
                  台送货车，其中乡镇覆盖
                  <input type="text" class="form-control num" name="zhen_car_num" style="min-width: 60px;width: 60px">
                  台
                </div>
             </td>
             <td style="min-width: 100px;width: 100px"><label for="" class="form-label">注册资金<span class="colorRed">*</span></label>
             </td>
             <td>
                <input type="text" class="form-control num" name="zhucezijin" style="min-width: 120px;width: 120px">万元
             </td>
          </tr>
          <tr>
            <td style="min-width: 160px;width: 160px"><label for="" class="form-label">经销商主要经销商网络<span class="colorRed">*</span></label>
             </td>
             <td colspan="3">
              <label class="checkbox-inline">
                   <input type="checkbox" name="main_channels[]" value="1"> A.批发
                </label>
              <label class="checkbox-inline">
                   <input type="checkbox" name="main_channels[]" value="2">B.分销商
              </label>
              <label class="checkbox-inline">
                    <input type="checkbox" name="main_channels[]" value="3">C.大商场
              </label>
               <label class="checkbox-inline">
                    <input type="checkbox" name="main_channels[]" value="4">D.乡镇批零店
              </label>
               <label class="checkbox-inline">
                    <input type="checkbox" name="main_channels[]" value="5">E.市区中小店
              </label>
               <label class="checkbox-inline">
                    <input type="checkbox" name="main_channels[]" value="6">F.团购
              </label>
               <label class="checkbox-inline">
                    <input type="checkbox" name="main_channels[]" value="7">G.封闭通路
              </label>
               <label class="checkbox-inline">
                    <input type="checkbox" name="main_channels[]" value="8">H.其他
              </label>
             </td>
          </tr>
          <tr>
             <td style="min-width: 160px;width: 160px"><label for="" class="form-label">经营网点数量<span class="colorRed">*</span></label>
             </td>
             <td colspan="3">
                <label for="" class="form-label">同品类</label>
                <input type="text" name="tongnet" class="form-control num" style="min-width: 100px;width: 100px">个,
                <label for="" class="form-label">非同品类</label>
                <input type="text" name="butongnet" class="form-control num" style="min-width: 100px;width: 100px">个
             </td>
          </tr>
          </table>
          <table class="table table-bordered">
              <tr>
                <th class="warning font-bold" colspan="9">以下是经销商所辖区域所有能经销销路通产品的网点情况(其他经营但不能销售销路通产品的网点均不计算在内)</th>
              </tr>
              <tr>
                <td style="min-width: 160px;width: 160px">网点类型</td>
                <td><label for="" class="form-label">KA类<span class="colorRed">*</span></label></td>
                <td><label for="" class="form-label">A类<span class="colorRed">*</span></label></td>
                <td><label for="" class="form-label">B类<span class="colorRed">*</span></label></td>
                <td><label for="" class="form-label">C类<span class="colorRed">*</span></label></td>
                <td><label for="" class="form-label">KC类<span class="colorRed">*</span></label></td>
                <td><label for="" class="form-label">批发<span class="colorRed">*</span></label></td>
                <td><label for="" class="form-label">特殊渠道<span class="colorRed">*</span></label></td>
                <td style="min-width: 200px;width: 200px"><label for="" class="form-label">小计</label></td>
              </tr>
              <tr>
                 <td style="min-width: 160px;width: 160px">辖区内的全部网点</td>
                <td><input type="text" class="form-control num net1" name="alln[]" style="min-width: 80px;width: 80px"></td>
                <td><input type="text" class="form-control num net1" name="alln[]" style="min-width: 80px;width: 80px"></td>
                <td><input type="text" class="form-control num net1" name="alln[]" style="min-width: 80px;width: 80px"></td>
                <td><input type="text" class="form-control num net1" name="alln[]" style="min-width: 80px;width: 80px"></td>
                <td><input type="text" class="form-control num net1" name="alln[]" style="min-width: 80px;width: 80px"></td>
                <td><input type="text" class="form-control num net1" name="alln[]" style="min-width: 80px;width: 80px"></td>
                <td><input type="text" class="form-control num net1" name="alln[]" style="min-width: 80px;width: 80px"></td>
                <td style="min-width: 200px;width: 200px"><input type="text" class="form-control net1all" style="min-width: 120px;width: 120px" readonly value="自动计算"></td>
              </tr>
               <tr>
                 <td style="min-width: 160px;width: 160px">预计销售销路通产品的网点</td>
                <td><input type="text" class="form-control num net2" name="yujin[]" style="min-width: 80px;width: 80px"></td>
                <td><input type="text" class="form-control num net2" name="yujin[]" style="min-width: 80px;width: 80px"></td>
                <td><input type="text" class="form-control num net2" name="yujin[]" style="min-width: 80px;width: 80px"></td>
                <td><input type="text" class="form-control num net2" name="yujin[]" style="min-width: 80px;width: 80px"></td>
                <td><input type="text" class="form-control num net2" name="yujin[]" style="min-width: 80px;width: 80px"></td>
                <td><input type="text" class="form-control num net2" name="yujin[]" style="min-width: 80px;width: 80px"></td>
                <td><input type="text" class="form-control num net2" name="yujin[]" style="min-width: 80px;width: 80px"></td>
                <td style="min-width: 200px;width: 200px"><input type="text" class="form-control net2all" style="min-width: 120px;width: 120px" readonly value="自动计算"></td>
              </tr>
               <tr>
                 <td style="min-width: 160px;width: 160px">未来待开发的网点</td>
                <td><input type="text" class="form-control num net3" name="weilain[]" style="min-width: 80px;width: 80px"></td>
                <td><input type="text" class="form-control num net3" name="weilain[]" style="min-width: 80px;width: 80px"></td>
                <td><input type="text" class="form-control num net3" name="weilain[]" style="min-width: 80px;width: 80px"></td>
                <td><input type="text" class="form-control num net3" name="weilain[]" style="min-width: 80px;width: 80px"></td>
                <td><input type="text" class="form-control num net3" name="weilain[]" style="min-width: 80px;width: 80px"></td>
                <td><input type="text" class="form-control num net3" name="weilain[]" style="min-width: 80px;width: 80px"></td>
                <td><input type="text" class="form-control num net3" name="weilain[]" style="min-width: 80px;width: 80px"></td>
                <td style="min-width: 200px;width: 200px"><input type="text" class="form-control net3all" style="min-width: 120px;width: 120px" readonly value="自动计算"></td>
              </tr>
               <tr>
                 <td style="min-width: 160px;width: 160px">销售比例</td>
                <td><input type="text" class="form-control num2 net4" name="bilin[]" style="min-width: 80px;width: 80px">%</td>
                <td><input type="text" class="form-control num2 net4" name="bilin[]" style="min-width: 80px;width: 80px">%</td>
                <td><input type="text" class="form-control num2 net4" name="bilin[]" style="min-width: 80px;width: 80px">%</td>
                <td><input type="text" class="form-control num2 net4" name="bilin[]" style="min-width: 80px;width: 80px">%</td>
                <td><input type="text" class="form-control num2 net4" name="bilin[]" style="min-width: 80px;width: 80px">%</td>
                <td><input type="text" class="form-control num2 net4" name="bilin[]" style="min-width: 80px;width: 80px">%</td>
                <td><input type="text" class="form-control num2 net4" name="bilin[]" style="min-width: 80px;width: 80px">%</td>
                <td style="min-width: 200px;width: 200px"><input type="text" class="form-control net4all" style="min-width: 120px;width: 120px" readonly value="自动计算">(相加起来必须为100%)</td>
              </tr>
               <tr>
                 <td style="min-width: 160px;width: 160px">预计各类别网点平均进场条码</td>
                <td><input type="text" class="form-control num" name="yujijin[]" style="min-width: 80px;width: 80px"></td>
                <td><input type="text" class="form-control num" name="yujijin[]" style="min-width: 80px;width: 80px"></td>
                <td><input type="text" class="form-control num" name="yujijin[]" style="min-width: 80px;width: 80px"></td>
                <td><input type="text" class="form-control num" name="yujijin[]" style="min-width: 80px;width: 80px"></td>
                <td><input type="text" class="form-control num" name="yujijin[]" style="min-width: 80px;width: 80px"></td>
                <td><input type="text" class="form-control num" name="yujijin[]" style="min-width: 80px;width: 80px"></td>
                <td><input type="text" class="form-control num" name="yujijin[]" style="min-width: 80px;width: 80px"></td>
                <td style="min-width: 200px;width: 200px">&nbsp;</td>
              </tr>
               <tr>
                <td style="min-width: 160px;width: 160px" rowspan="3">目前主要代理的品牌销售情况</td>
                <td colspan="4">
                  1.{$year}年销售<input type="text" class="form-control" style="min-width: 100px;width: 100px" name="lastyearp[]"><label for="" class="form-label">品牌</label><input type="text" style="min-width: 80px;width: 80px" name="lastyearm[]"  class="form-control num2">万元
                </td>
                <td colspan="4">
                  <label for="" class="form-label">去年年销售总额<span class="colorRed">*</span></label><input type="text" style="min-width: 80px;width: 80px" name="lastyearzong" class="form-control num2">万元
                </td>
              </tr>
              <tr>
                 <td colspan="4">
                  2.{$year}年销售<input type="text" class="form-control" style="min-width: 100px;width: 100px" name="lastyearp[]"><label for="" class="form-label">品牌</label><input type="text" style="min-width: 80px;width: 80px" name="lastyearm[]"  class="form-control num2">万元
                </td>
                <td colspan="4">
                  <label for="" class="form-label">在当地同品类经销商中的排行名次<span class="colorRed">*</span></label><input type="text" style="min-width: 80px;width: 80px" name="lastyearno"  class="form-control num">(1-100以内的整数)
                </td>
              </tr>
               <tr>
                 <td colspan="4">
                  3.{$year}年销售<input type="text" class="form-control" style="min-width: 100px;width: 100px" name="lastyearp[]"><label for="" class="form-label">品牌</label><input type="text" style="min-width: 80px;width: 80px" name="lastyearm[]"  class="form-control num2">万元
                </td>
                <td colspan="4">
                  <label for="" class="form-label">在当地的影响力<span class="colorRed">*</span></label>
                   <label class="radio-inline">
                   <input type="radio" checked name="power" value="1"> 强
                  </label>
                  <label class="radio-inline">
                   <input type="radio" name="power" value="2">一般
                  </label>
                  <label class="radio-inline">
                    <input type="radio" name="power" value="3">弱
                   </label>
                </td>
              </tr>
              <tr>
                <td colspan="5">
                    <label for="" class="form-label">价格掌控力</label>
                  <label class="radio-inline">
                   <input type="radio" checked name="zhangkong" value="1">A.强无冲货
                  </label>
                  <label class="radio-inline">
                   <input type="radio" name="zhangkong" value="2">B.一般无主动冲货
                  </label>
                  <label class="radio-inline">
                    <input type="radio" name="zhangkong" value="3">C.差经营主动冲货
                   </label>
                </td>
                <td colspan="4">
                    <label for="" class="form-label">信誉度：</label>
                  <label class="radio-inline">
                   <input type="radio" checked name="xinyu" value="1">A.当地美誉高度
                  </label>
                  <label class="radio-inline">
                   <input type="radio" name="xinyu" value="2">B.一般
                  </label>
                  <label class="radio-inline">
                    <input type="radio" name="xinyu" value="3">C.差/涉黑
                   </label>
                </td>
              </tr>
          </table>
           <table class="table table-bordered">
            <tr>
              <th class="info font-bold" colspan="3">四、新增经销商财务状况(可填)</th>
            </tr>
            <tr>
                <td>
                  <div class="form-group">
                   <label for="" class="form-label">截止目前流动资产总额：</label>
                   <input type="text" name="liudong" class="form-control num2" style="min-width: 100px;width: 100px">
                   万元
                  </div>
                </td>
                <td>
                   <div class="form-group">
                   <label for="" class="form-label">截止目前流动负债总额：</label>
                   <input type="text" name="liudongfu" class="form-control num2" style="min-width: 100px;width: 100px">
                   万元
                  </div>
                </td>
                <td>
                   <div class="form-group">
                   <label for="" class="form-label">应收账款总额：</label>
                   <input type="text" name="yingshou" class="form-control num2" style="min-width: 100px;width: 100px">
                   万元
                  </div>
                </td>
            </tr>
            <tr>
               <td>
                  <div class="form-group">
                   <label for="" class="form-label">截止目前流动资产总额：</label>
                   <input type="text" name="liudongz" class="form-control num2" style="min-width: 100px;width: 100px">
                   万元
                  </div>
                </td>
                <td>
                   <div class="form-group">
                   <label for="" class="form-label">截止目前总资产总额：</label>
                   <input type="text" name="zongzichan" class="form-control num2" style="min-width: 100px;width: 100px">
                   万元
                  </div>
                </td>
                <td>
                   <div class="form-group">
                   <label for="" class="form-label">截止目前总负债总额：</label>
                   <input type="text" name="zongfu" class="form-control num2" style="min-width: 100px;width: 100px">
                   万元
                  </div>
                </td>
            </tr>
            <tr>
                <td colspan="3">
                   <div class="form-group">
                   <label for="" class="form-label">保证金：</label>
                   <input type="text" name="baozheng" class="form-control num2" style="min-width: 100px;width: 100px">
                   万元
                  </div>
                </td>
            </tr>
           </table>
          <table class="table table-bordered">
           <tr>
              <th colspan="2" class="info font-bold">五、新增经销商历史状况</th>
           </tr>
           <tr>
              <td>
                 <label for="" class="form-label">是否曾经和销路通合作过<span class="colorRed">*</span></label> 
                 <label class="radio-inline">
                      <input type="radio" checked name="iscom" checked value="1">是
                </label>
                <label class="radio-inline">
                      <input type="radio" name="iscom"  value="2">否
                </label>
                <span class="font-bold">(选是,新增经销商历史状况各项必填)</span>
              </td>
              <td>
                 <label for="" class="form-label">前期合作期间所辖的区域<span class="colorRed">*</span>:</label> 
                 <input type="text" name="com_area" class="form-control">
              </td>
           </tr>
           <tr>
              <td>
                <div class="form-group">
                   <label for="" class="form-label">合作期间的销售情况<span class="colorRed">*</span></label>
                 <input type="text" class="form-control num" name="com_start" style="min-width: 80px;width: 80px"> 
                 年至
                  <input type="text" class="form-control num" name="com_end" style="min-width: 80px;width: 80px">
                  年,年均销售
                   <input type="text" class="form-control num2" name="com_money" style="min-width: 80px;width: 80px">
                   万元
                </div>
              </td>
              <td>
                  <div class="form-group">
                     <label for="" class="form-label">其他情况:</label>
                     <input type="text" name="com_other" class="form-control">
                  </div>
              </td>
           </tr>
           <tr>
              <td colspan="2">
                <div class="form-group">
                   <label for="" class="form-label">前期因何原因终止合作<span class="colorRed">*</span>：</label>
                 <input type="text" class="form-control" name="end_reson" style="min-width: 640px;width:640px">
                </div>
              </td>
           </tr>
         </table>
          <table class="table table-bordered">
           <tr>
              <th colspan="3" class="info font-bold">六、新增经销商合作后的配套情况</th>
           </tr>
           <tr>
              <td rowspan="2" style="min-width: 160px;width: 160px">
                 <label for="" class="form-label">人员配置<span class="colorRed">*</span>：</label>
              </td>
              <td>
                 <label for="" class="form-label">是否配专人专卖销路通产品：</label>
                  <label class="radio-inline">
                      <input type="radio" checked name="iszhuan"  value="1">是
                </label>
                <label class="radio-inline">
                      <input type="radio" name="iszhuan"  value="2">否
                </label>
              </td>
              <td>
                   <label for="" class="form-label">专职经理<span class="colorRed">*</span>：</label> 
                    <input type="text" class="form-control num" name="zhuan_man" style="min-width: 80px;width: 80px"> 
                  人；专职业代
                  <input type="text" class="form-control num" name="zhuan_dai" style="min-width: 80px;width: 80px">
                  人
              </td>
           </tr>
           <tr>
              <td colspan="2">
                车辆配送：专车<input type="text" class="form-control num" name="zhuanche" style="min-width: 80px;width: 80px">辆；混车<input type="text" class="form-control num" name="hunche" style="min-width: 80px;width: 80px">辆来配送销路通产品。(两辆都有就都填)
              </td>
           </tr>
            <tr>
                <td style="min-width: 160px;width: 160px"> <label for="" class="form-label">专项营运资金<span class="colorRed">*</span>：</label> </td>
                <td>
                  应到位资金：<input type="text" name="daowei" class="form-control num2">万元
                </td>
                <td>
                  <div class="form-group">
                     <label for="" class="form-label">首批回款<span class="colorRed">*</span>：</label>
                   <input type="text" class="form-control num2" name="shoupi">万元 
                  </div>
                </td>
            </tr>
            <tr>
               <td style="min-width: 160px;width: 160px"> <label for="" class="form-label">仓库情况<span class="colorRed">*</span>：</label> </td>
               <td colspan="2">
                  仓库<input type="text" class="form-control num" style="min-width: 80px;width: 80px" name="ku_ceng">层；每层高<input type="text" class="form-control num2" name="ku_gao" style="min-width: 80px;width: 80px">米；合计面积<input type="text" name="ku_mianji" class="form-control num2" style="min-width: 80px;width: 80px">平方米；预留存放销路通产品的面积<input type="text" name="ku_my_mianji" class="form-control num2" style="min-width: 80px;width: 80px">平方米
               </td>
            </tr>
            <tr>
                 <td style="min-width: 160px;width: 160px"> <label for="" class="form-label">C类店情况</label> </td>
                 <td colspan="2">
                   <div class="col-xs-3"> C类店具体分销条码为：</div>
                     <div class="col-xs-5">
                        <div class="input-group" id="" >
                            <input type="text"   placeholder="请输入关键字或空格查询" class="form-control inputremindPeple" id="productp"  value="{:isset($supply)?$supply.jxs:''}">
                            <input type="hidden" name="prosp" id="prosp"/>
                            <div class="input-group-btn">
                                <ul class="dropdown-menu dropdown-menu-right" role="menu">
                                </ul>
                            </div>
                        </div>
                    </div>
                    <div class="col-xs-2">
                        <button class="btn btn-primary btn-sm" id="select_productp">选择</button>
                    </div>
                 </td>
            </tr>
            <tr>
                <td style="min-width: 160px;width: 160px">&nbsp;</td>
                <td colspan="2">
                  <div class="duoxuan" id="selected_productp"></div>
                </td>
            </tr>
          </table>
           <table class="table table-bordered">
           <tr>
              <th colspan="4" class="info font-bold">七、销路通配套支持情况</th>
           </tr>
           <tr>
              <td rowspan="2" style="min-width: 160px;width: 160px"> <label for="" class="form-label">由谁专营经销商<span class="colorRed">*</span>：</label></td>
              <td rowspan="2">
                  <div class="container-fluid">
                            <div class="row">
                                <div class="col-xs-8">
                                    <div class="input-group" style="display: none;" >
                                        <input type="text" placeholder="请输入关键字或空格查询" class="cname form-control"  name="zhuanyingren" value="{$user.id}">
                                        <div class="input-group-btn">
                                            <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
                                                <span class="caret"></span>
                                            </button>
                                            <ul class="dropdown-menu dropdown-menu-right" role="menu">
                                            </ul>
                                        </div>
                                    </div>
                                    <div class="selectedOnlyOne "  >
                                      
                                        <span class="inin">{$user.em_name}</span>
                                        <span class="close">×</span>
                                    </div>
                                </div>
                                <div class="col-xs-4">
                                    <button type="button" class="btn btn-primary select_cname" >选择</button>
                                </div>
                           </div>
                        </div>
              </td>
              <td rowspan="2">
                <div class="form-group">
                   <label for="" class="form-label">预计设业代<span class="colorRed">*</span>：</label>
                   <input type="text" name="yujisheyedai" class="form-control num" style="min-width: 120px;width: 120px">人
                </div>
              </td>
              <td>
                <div class="form-group">
                   <label for="" class="form-label">预计设专职导购<span class="colorRed">*</span>：</label>
                   <input type="text" class="form-control num" name="zhuan_dg_dian" style="min-width: 80px;width: 80px">
                   家卖场
                    <input type="text" class="form-control num" name="zhuan_dg_ren" style="min-width: 80px;width: 80px">
                  人(手填)
                </div>
              </td>
           </tr>
           <tr>
              <td>
                 <div class="form-group">
                   <label for="" class="form-label">预计设兼职导购<span class="colorRed">*</span>：</label>
                   <input type="text" class="form-control num" name="jian_dg_dian" style="min-width: 80px;width: 80px">
                   家卖场
                    <input type="text" class="form-control num" name="jian_dg_ren" style="min-width: 80px;width: 80px">
                  人(手填)
                </div>
              </td>
           </tr>
           <tr>
              <td colspan="4">
                  <span>资信限额支持方式：</span>
                  <div class="form-group">
                 <label class="radio-inline">
                      <input type="radio" name="zxfs" checked  value="1">A.现款现货(默认项)
                </label>
                 <label class="radio-inline">
                      <input type="radio" name="zxfs"  value="2">B.铺底
                </label>
                   <label class="radio-inline">
                      <input type="radio" name="zxfs"  value="3">C.信用额度
                </label>
                 <label class="radio-inline">
                      <input type="radio" name="zxfs"  value="4">D.账期(BCD默认不支持，特殊经销商另行申请方可执行)
                </label>
                   </div> 
              </td>
           </tr>
           </table>
            <table class="table table-bordered">
           <tr>
              <th colspan="6" class="info font-bold">八、新增经销商其他情况</th>
           </tr>
           <tr>
              <td style="min-width: 160px;width: 160px"> <label for="" class="form-label" >是否是BDF经销商</label></td>
              <td>
                   <label class="radio-inline">
                      <input type="radio" checked name="is_bdf" id="inlineRadio2zs" checked value="2">否
                </label>
                   <label class="radio-inline">
                      <input type="radio" name="is_bdf" id="inlineRadio3zs" value="1">是
                </label>
              </td>
             <td style="min-width: 160px;width: 160px"> <label for="" class="form-label">信用额度(元)</label></td>
             <td><input type="text" name="xingyongedu" class="form-control num2"></td>
               <td style="min-width: 160px;width: 160px"> <label for="" class="form-label">DGA准备金率</label></td>
             <td><input type="text" name="dgalv" class="form-control num">%</td>
           </tr>
            <tr>
              <td style="min-width: 160px;width: 160px"> <label for="" class="form-label">是否有账期</label></td>
              <td>
                   <label class="radio-inline">
                      <input type="radio" checked name="iszhang"  value="2">否
                </label>
                   <label class="radio-inline">
                      <input type="radio" name="iszhang"  value="1">是
                </label>
              </td>
             <td style="min-width: 160px;width: 160px"> <label for="" class="form-label"></label>账期天数</td>
             <td><input type="text" name="zhangtian" class="form-control num"></td>
               <td style="min-width: 160px;width: 160px"> <label for="" class="form-label">DGA百分比</label></td>
             <td><input type="text" name="dgabi" class="form-control num">%</td>
           </tr>
           <tr>
             <td style="min-width: 160px;width: 160px"> <label for="" class="form-label">返利政策描述</label></td>
             <td colspan="5">
                 <div class="ibox float-e-margins" style="margin-bottom: 0">
                    <div class="ibox-content no-padding">

                        <textarea name="miaoshu" style="resize: none;height:150px;width:100%" class="form-control"></textarea>
                    </div>
                </div>
             </td>
           </tr>
          </table>
          <table class="table table-bordered nineTable">
          <thead>
           <tr>
              <th colspan="3" class="info font-bold">九、新增经销商BDF对应品牌情况</th>
           </tr>  
           <tr>
              <th class="text-center info">BDF对应品牌</th>
              <th class="text-center info">BDF对应百分比</th>
              <th class="text-center info" style="min-width: 60px;width: 60px"><button class="btn btn-info addTr" type="button">添加</button></th>
           </tr>
           </thead>
           <tbody id="tbpdf">
              
           </tbody>
          
          </table>
        <div class="ibox-content " style="border:1px solid #ccc;background: #ffff9c">
         注意事项：开户需提供①营业执照②企业代码证③税务登记证(国税)④购销合同：如客户需开具增值税发票则必须提供⑤一般纳税人资格证和已盖公章的⑥增值税开票资料。可作为附件提交或传真至x部门，电话：000-0000000.
        </div>
       <div class="form-group white-bg" style="margin:20px 10px 20px 20px;">
            <div id="uploader" class="wu-example">
                <!--用来存放文件信息-->
                <div id="thelist" class="uploader-list">
                   {volist name="fujian" id="fo"}
                        <h4>{$fo.file_name}</h4>
                   {/volist}
                </div>
                <div class="btns">
                    <div id="picker">选择文件</div>
                    <button id="ctlBtn" class="btn btn-default">开始上传</button>
                </div>
                <input type="hidden" name="attach" id="attach" {if $kid} value="{$apply.annex_id}" {/if} >
            </div>
            <span>注：最多上传15个文件，每个文件小于50M,支持格式：</span><br>jpg,bnp,gif,png,jpeg,tif,raw,doc,docx,xls,xlsx,ppt,pptx,txt,pdf,rar,zip,mp4,avi,rmvb,rm,mid,3gp,AVI,3GP,,mpg,mp3,wma,wav
        </div>
       <div class="row sub_btn" style="width:100%;text-align:center;padding: 20px 0">
        <input type="button" class="btn btn-success" onclick="baocun(1)" value="保存为草稿">
        <input type="button" class="btn btn-info" onclick="baocun(3)" value="保存并提交流程">
        <input type="button" class="btn btn-warning" value="返回" id="toc2">
    </div>
</form>
    </div>
    <!-- 全局js -->
    <script src="__STATIC__/layout/js/jquery.min.js?v=2.1.4"></script>
    <script src="__STATIC__/layout/js/bootstrap.min.js?v=3.3.6"></script>
    <!-- <script src="js/plugins/metisMenu/jquery.metisMenu.js"></script> -->
    <script src="__STATIC__/layout/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
      <script src="__STATIC__/layout/js/plugins/summernote/summernote.min.js"></script>
    <script src="__STATIC__/layout/js/plugins/summernote/summernote-zh-CN.js"></script>
    <!--统计代码，可删除-->
    <script src="__STATIC__/layout/js/plugins/layer/laydate/laydate.js"></script>
    <script src="__STATIC__/layout/js/plugins/sweetalert/sweetalert.min.js"></script>
    <script src="__STATIC__/layout/js/common.js"></script>
    <script src="__STATIC__/layout/js/plugins/suggest/bootstrap-suggest.min.js"></script>
<script src="__STATIC__/layout/js/plugins/layer/layer.min.js"></script>
    <script>
    function addpro(){
       var str="<tr>";
            str+='<td class="text-center" style="width:40%">';
            str+='<div class="container-fluid">';
            str+='<div class="row">';
            str+='<div class="input-group" >';
            str+='<input type="text" placeholder="请输入关键字或空格查询" class="bdfpro form-control"  name="bdfpro[]" value="">';
            str+='<div class="input-group-btn">';
            str+='<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">';
            str+='<span class="caret"></span>';
            str+='</button>';
            str+='<ul class="dropdown-menu dropdown-menu-right" role="menu">';
            str+='</ul>';
            str+='</div>';
            str+='</div>';
            str+='<div class="selectedOnlyOne " style="display: none;"  >';
            str+='<span class="inin"></span>';
            str+='<span class="close">×</span>';
            str+='</div>';
            str+='</div>';
            str+='</div>';
            str+='</td>';
            str+='<td class="text-center" style="width:40%"><input type="text" name="bdfprobi[]" class="form-control num" style="min-width: 80px;width: 80px">%</td>';
            str+='<td class="text-center" style="width:20%"><button type="button" class="btn-danger btn delthis">删除</button></td>';
            str+='</tr>';
            $("#tbpdf").append(str);
            $(".bdfpro").bsSuggest({
                url: "{:url('select/brandjson')}",
                /*effectiveFields: ["userName", "shortAccount"],
                 searchFields: [ "shortAccount"],*/
                effectiveFieldsAlias:{title: "名称"},
                ignorecase: true,
                showHeader: true,
                showBtn: false,     //不显示下拉按钮
                delayUntilKeyup: true, //获取数据的方式为 firstByUrl 时，延迟到有输入/获取到焦点时才请求数据
                idField: "id",
                keyField: "title",
                clearable: true
            }).on('onSetSelectValue', function (e, keyword, data) {
              var flag=0;
                $(".bdfpro").each(function(){
                  if(keyword.id==$(this).val()){
                      flag=1;return false;
                  }

                })
                if(flag==0){
                  $(this).closest('.input-group').hide().next('.selectedOnlyOne').show().find('.inin').html(keyword.key)
                  $(this).val(keyword.id)
                }else{
                  swal({title: "",
                                text: "BDF对应品牌已存在",
                                type: "warning"});
                  $(this).val("");
                }
                
                 

            });
    }
    $(".addTr").click(function(){
       addpro();
    })
    addpro();
    //提交保存
    function baocun(state){
      var prolist=[];
      $(".prolist").each(function(){
        prolist.push($(this).attr("data-id"));
      })
      $("#pros").val(prolist.join(','))
      var prolistp=[];
      $(".proplist").each(function(){
        prolistp.push($(this).attr("data-id"));
      })
      $("#prosp").val(prolistp.join(','))
      $("#state").val(state);
            $.ajax({
                        cache: true,
                        type: "POST",
                        url:"{:url('kaihucaozuo')}",
                        data:$('#f1').serialize(),// 你的formid
                        async: false,
                        error: function(requests) {
                            alert("Connection error");
                        },
                        success: function(datas) {
                          //alert(datas);
                          
                          var res1=JSON.parse(datas);
                            if(res1["state"]==1){
                              swal({
                                title: "完成",
                                text: "操作已成功",
                                type: "success"
                                },function(){
                                  //location.href="{:url('add')}"
                                  //
                                  parent.layer.close(parent.layer.getFrameIndex(window.name))
                                });

                          }else{
                            swal({
                            title: "错误",
                            text:  res1["msg"],
                            type: "warning"
                            });
                          }
                        }
                });
    }
    //弹出选择我的支付人树
        $('body').on('click','.select_cname',function () {
            var _this = this
                layer.open({
                    type:2,
                    area:['60%','60%'],
                    title:'支付人树',
                    maxmin:true,
                    content:'{:url("Apcaiwu/selectCname")}',
                    btn:'确定',
                    btnAlign:'c',
                    yes:function (i,o) {

                        var id = $(o).find('iframe').contents().find('#renyuan').val()
                        var name = $(o).find('iframe').contents().find('#renyuanname').val()
                        if(id){
                            $(_this).closest('div').prev('div').find('.input-group').hide().find('.feetype').val(id)
                            $(_this).closest('div').prev('div').find('.selectedOnlyOne').show().find('.inin').html(name)
                        }
                        layer.close(i)
                    }
                })
                return  false
        })
          //支付人搜索自动补全
    $(".cname").bsSuggest({
        url: "{:url('Apcaiwu/cnamejson')}",
        /*effectiveFields: ["userName", "shortAccount"],
         searchFields: [ "shortAccount"],*/
        effectiveFieldsAlias:{title: "名称"},
        ignorecase: true,
        showHeader: true,
        showBtn: false,     //不显示下拉按钮
        delayUntilKeyup: true, //获取数据的方式为 firstByUrl 时，延迟到有输入/获取到焦点时才请求数据
        idField: "id",
        keyField: "title",
        clearable: true
    }).on('onSetSelectValue', function (e, keyword, data) {
        $(this).closest('.input-group').hide().next('.selectedOnlyOne').show().find('.inin').html(keyword.key)
        $(this).val(keyword.id)

    });
   
      //取消单选
    $('body').on('click','.delthis',function(){
      $(this).parent().parent().remove();
    })
    $('body').on('click','.selectedOnlyOne .close',function () {
        $(this).closest('.selectedOnlyOne').hide().find('.inin').html('')
        $(this).closest('.selectedOnlyOne').prev('.input-group').show().find('input').val('')
    })
    $(document).on("click",".proplist .close",function(){
          var pid=$(this).parent().attr("data-id");
          //alert(pid);
          //$("tr[proid="+pid+"]").remove();
          $(this).parent().remove();
       })
       $(document).on("click",".prolist .close",function(){
          var pid=$(this).parent().attr("data-id");
          //alert(pid);
          //$("tr[proid="+pid+"]").remove();
          $(this).parent().remove();
       })
        //弹出选择系列框
        $('#select_product').on('click',function () {
                var index = layer.getFrameIndex(window.name)
                layer.open({
                    type:2,
                    area:['60%','60%'],
                    maxmin:true,
                    content:'{:url("selectseries")}'
                })
                return  false
        })
      //产品单品搜索自动补全
    $("#product").bsSuggest({
        url: "{:url('select/seriesjson')}",
        /*effectiveFields: ["userName", "shortAccount"],
         searchFields: [ "shortAccount"],*/
        effectiveFieldsAlias:{title: "名称"},
        ignorecase: true,
        showHeader: true,
        showBtn: false,     //不显示下拉按钮
        delayUntilKeyup: true, //获取数据的方式为 firstByUrl 时，延迟到有输入/获取到焦点时才请求数据
        idField: "id",
        keyField: "title",
        clearable: true
    }).on('onSetSelectValue', function (e, keyword, data) {
        $(this).val('')
        var bool = false
        $('#selected_product .ren').each(function (idx,o) {
            if($(this).data('id') == keyword.id){
                bool = true;
            }
        })
        if(bool == false){
            $('#selected_product').append('<span class="ren prolist" data-id="'+keyword.id+'">'+keyword.key+'<span class="close">×</span></span>');
        }
    });
      //弹出选择系列框
        $('#select_productp').on('click',function () {
                var index = layer.getFrameIndex(window.name)
                layer.open({
                    type:2,
                    area:['60%','60%'],
                    maxmin:true,
                    content:'{:url("selectproduct")}'
                })
                return  false
        })
      //产品单品搜索自动补全
    $("#productp").bsSuggest({
        url: "{:url('select/productjson')}",
        /*effectiveFields: ["userName", "shortAccount"],
         searchFields: [ "shortAccount"],*/
        effectiveFieldsAlias:{title: "名称"},
        ignorecase: true,
        showHeader: true,
        showBtn: false,     //不显示下拉按钮
        delayUntilKeyup: true, //获取数据的方式为 firstByUrl 时，延迟到有输入/获取到焦点时才请求数据
        idField: "id",
        keyField: "title",
        clearable: true
    }).on('onSetSelectValue', function (e, keyword, data) {
        $(this).val('')
        var bool = false
        $('#selected_productp .ren').each(function (idx,o) {
            if($(this).data('id') == keyword.id){
                bool = true;
            }
        })
        if(bool == false){
            $('#selected_productp').append('<span class="ren proplist" data-id="'+keyword.id+'">'+keyword.key+'<span class="close">×</span></span>');
        }
    });
    function chongzhisheng(zid){
      $("#provices").html("<option value='0'>请选择</option>")
      $("#provices").val(0);
      
     if(zid!=0){
      $.post("{:url('getp')}",{zid:zid},function(re){
        var data=JSON.parse(re);
        for(var i=0;i<data.length;i++){
          $("#provices").append("<option value='"+data[i]["id"]+"'>"+data[i]["title"]+"</option>")
        }
      })
     }
      chongzhishi(0);
    }
    function chongzhishi(pid){
      $("#citys").html("<option value='0'>请选择</option>");
       $("#citys").val(0);
      if(pid!=0){
        $.post("{:url('getc')}",{pid:pid},function(re){
        var data=JSON.parse(re);
        for(var i=0;i<data.length;i++){
          $("#citys").append("<option value='"+data[i]["id"]+"'>"+data[i]["title"]+"</option>")
        }
      })
      }
      
    }
    $("#zon").change(function(){
      chongzhisheng($(this).val());
    })
    $("#provices").change(function(){
      chongzhishi($(this).val());
    })
  $(document).ready(function () {
    $(".num2").blur(function(){
      if(isNaN(parseFloat($(this).val()))){
        $(this).val("");
      }else{
        $(this).val(parseFloat($(this).val()).toFixed(2));
      }
    })
     $(".num").blur(function(){
      if(isNaN(parseInt($(this).val()))){
        $(this).val("");
      }else{
        $(this).val(parseInt($(this).val()));
      }
    })
 //计算数量
    
      $(".net1").blur(function(){
      
         var sum=0;
          $(".net1").each(function(){
            if($(this).val()!="")
              sum+=parseFloat($(this).val());
          })
          $(".net1all").val(sum);
      })
    $(".net2").blur(function(){
      
         var sum=0;
          $(".net2").each(function(){
            if($(this).val()!="")
              sum+=parseFloat($(this).val());
          })
          $(".net2all").val(sum);
      })
     $(".net3").blur(function(){
      
         var sum=0;
          $(".net3").each(function(){
            if($(this).val()!="")
              sum+=parseFloat($(this).val());
          })
          $(".net3all").val(sum);
      })
      $(".net4").blur(function(){
      
         var sum=0;
          $(".net4").each(function(){
            if($(this).val()!="")
              sum+=parseFloat($(this).val());
          })
          $(".net4all").val(sum);
      })
          

      /*点击返回跳转到新增经销商评估及资料表*/
      $("#toc2").click(function(){
        //location.href="custom2.html"
        parent.layer.close(parent.layer.getFrameIndex(window.name))
      })
   })
       //日期范围限制
        var start = {
            elem: '#start',
            format: 'YYYY/MM/DD',
            min: laydate.now(), //设定最小日期为当前日期
            max: '2099-06-16 23:59:59', //最大日期
            istime: true,
            istoday: false,
            choose: function (datas) {
                end.min = datas; //开始日选好后，重置结束日的最小日期
                end.start = datas //将结束日的初始值设定为开始日
            }
        };
        var end = {
            elem: '#end',
            format: 'YYYY/MM/DD',
            min: laydate.now(),
            max: '2099-06-16 23:59:59',
            istime: true,
            istoday: false,
            choose: function (datas) {
                start.max = datas; //结束日选好后，重置开始日的最大日期
            }
        };
        laydate(start);
        laydate(end);
    </script>
       <!-- Web Uploader -->
<script type="text/javascript">
    // 添加全局站点信息
    var BASE_URL = '__STATIC__/layout/js/plugins/webuploader';
</script>
<script src="__STATIC__/layout/js/plugins/webuploader/webuploader.min.js"></script>
<script type="text/javascript">
   // 文件上传
    jQuery(function() {
        var $ = jQuery,
            $list = $('#thelist'),
            $btn = $('#ctlBtn'),
            state = 'pending',
            uploader;

        var ids = [{if $kid} value="{$apply.annex_id}" {/if}];
        uploader = WebUploader.create({

            // 不压缩image
            resize: false,

            // swf文件路径
            swf: BASE_URL + '/js/Uploader.swf',

            // 文件接收服务端。
            server: '{:url("upload/fileupload")}',

            // 选择文件的按钮。可选。
            // 内部根据当前运行是创建，可能是input元素，也可能是flash.
            pick: '#picker'
        });

        // 当有文件添加进来的时候
        uploader.on( 'fileQueued', function( file ) {
            $list.append( '<div id="' + file.id + '" class="item">' +
                '<h4 class="info">' + file.name + '</h4>' +
                '<p class="state">等待上传...</p>' +
                '</div>' );
        });

        // 文件上传过程中创建进度条实时显示。
        uploader.on( 'uploadProgress', function( file, percentage ) {
            var $li = $( '#'+file.id ),
                $percent = $li.find('.progress .progress-bar');

            // 避免重复创建
            if ( !$percent.length ) {
                $percent = $('<div class="progress progress-striped active">' +
                    '<div class="progress-bar" role="progressbar" style="width: 0%">' +
                    '</div>' +
                    '</div>').appendTo( $li ).find('.progress-bar');
            }

            $li.find('p.state').text('上传中');

            $percent.css( 'width', percentage * 100 + '%' );
        });

        uploader.on( 'uploadSuccess', function( file,response) {
            if(response.success)
                ids.push(response.id)
            $( '#'+file.id ).find('p.state').text(response.msg);
        });

        uploader.on( 'uploadError', function( file ) {
            $( '#'+file.id ).find('p.state').text('上传出错');
        });

        uploader.on( 'uploadComplete', function( file ) {
            $('#attach').val(ids.join(','))
            $( '#'+file.id ).find('.progress').fadeOut();
        });

        uploader.on( 'all', function( type ) {
            if ( type === 'startUpload' ) {
                state = 'uploading';
            } else if ( type === 'stopUpload' ) {
                state = 'paused';
            } else if ( type === 'uploadFinished' ) {
                state = 'done';
            }

            if ( state === 'uploading' ) {
                $btn.text('暂停上传');
            } else {
                $btn.text('开始上传');
            }
        });

        $btn.on( 'click', function() {
            if ( state === 'uploading' ) {
                uploader.stop();
            } else {
                uploader.upload();
            }
            return false
        });
     })

</script>
</body>

</html>
